<?php $this->load->view('templates/backend/header'); ?>
<style>
    .table .new,.notice{
        font-weight: bold;
        color:#D65824;
    }
    .table-bordered{
            border-top:1px solid #ccc;
    }
    .pagination {
        display: inline-block;
        padding-left: 0;
        margin: 20px 0;
        border-radius: 4px;
      }
      .pagination>li {
        display: inline;
      }
      .pagination>li>a, .pagination>li>span {
        position: relative;
        float: left;
        padding: 6px 12px;
        margin-left: -1px;
        line-height: 1.42857143;
        color: #337ab7;
        text-decoration: none;
        background-color: #fff;
        border: 1px solid #ddd;
      }
</style>

<link rel="stylesheet" href="<?php echo base_url().'static/templates/backend/css/jquery.fancybox.css';?>"/>
<script type="text/javascript" src="<?php echo base_url().'static/templates/backend/js/jquery.fancybox.js';?>"></script>
<script type="text/javascript" src="<?php echo base_url().'static/templates/backend/js/popup.js';?>"></script>
<h1><?php echo $this->lang->line("list_booking_paid");?></h1>
<?php
if(!empty($lists)){
?>
<table class="table table-striped table-bordered dataTable" id="data-table" width="100%" aria-describedby="data-table_info" style="width: 100%;">
    <?php if(!empty($lists)){?>
    <thead>
        <tr role="row">
            <th width="5%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" aria-label="STT" style="width: 50px;">STT</th>
            <th width="5%" class="sorting_desc" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" aria-label="Username" style="width: 280px;"><?php echo $this->lang->line('name');?></th>
            <th width="5%" class="sorting_desc" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" aria-label="Username" style="width: 280px;"><?php echo $this->lang->line('booking_place_code');?></th>
            <th width="20%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" style="width: 181px;"><?php echo $this->lang->line('airline');?></th>
            <th width="20%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" style="width: 181px;"><?php echo $this->lang->line('payment_method');?></th>
            
            <th width="20%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" style="width: 181px;"><?php echo $this->lang->line('net_fare').'(VNĐ)';?></th>
            <th width="20%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" style="width: 181px;"><?php echo $this->lang->line('real_fare').'(VNĐ)';?></th>
            
            <th width="20%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" style="width: 181px;"><?php echo $this->lang->line('payment_confirm');?></th>
            <th width="20%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" style="width: 181px;"><?php echo $this->lang->line('booker');?></th>
            <th width="20%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" style="width: 181px;"><?php echo $this->lang->line('lastupdated');?></th>
            <th width="20%" class="sorting" role="columnheader" tabindex="0" aria-controls="data-table" rowspan="1" colspan="1" style="width: 181px;"></th>
    </thead>
    <?php }?>
    <tbody role="alert" aria-live="polite" aria-relevant="all">
        <?php
        foreach($lists as $key => $values){
            echo '<tr>';
                echo '<td>'.++$key.'</td>';
                echo '<td>'.$values->name.'</td>';
                echo '<td width="10%">'.$values->booking_place_code.'</td>';
                echo '<td width="3%">'.$values->airline.'</td>';
                echo '<td width="15%">'.$values->payment_name.'</td>';
                echo '<td width="10%">'.$this->bookinglib->my_number_format($values->net_fare, 2, ',', ',').'</td>';
                echo '<td width="10%">'.$this->bookinglib->my_number_format($values->real_fare, 2, ',', ',').'</td>';
                echo '<td width="7%">';
                    if($values->payment_air == 1){
                        echo 'OK';
                    } else {
                        echo 'NO';
                    }
                echo '</td>';
                echo '<td>'.$values->username.'</td>';
                echo '<td>'.date('d-m-Y H:i:s',$values->lastupdated).'</td>';
                echo '<td><a href="'.base_url().'auth/bookhistory/updateBill?customerID='.$values->customerID.'" class="fancy-sl"><img src="'.base_url().'static/templates/backend/images/icon/print.png"></a></td>';
            echo '</tr>';
        }
        ?>
    </tbody>
</table>
<div id="pagination">
    <ul class="pagination">
        <?php
        
        $i = $page - 1;
        if($i > 0){
            while($i < $total){
                if($i == $page){
                    echo '<li><span><b>'.$i.'</b></span></li>';
                } else {
                    echo '<li><a href="bookhistory.html?page='.$i.'">'.$i.'</a></li>';
                }
                if($i == $page + 1){
                    break;
                }
                $i++;
            }
        } else {
            echo '<li><a href="bookhistory.html">Trang đầu</a></li>';
            if($total > 1){
                echo '<li><a href="bookhistory.html?page=1">1</a></li><li><a href="bookhistory.html?page=2">2</a></li>';
            } else {
                echo '<li><a href="bookhistory.html?page=1">1</a></li>';
            }
        }
        ?>
    </ul>
</div>
<?php
} else {
	echo '<tr>Không tìm thấy thông tin</tr>';
}
?>
<?php $this->load->view('templates/backend/footer'); ?>